package com.hong.springboot.config;

import org.openjdk.btrace.core.annotations.*;
import org.openjdk.btrace.core.types.AnyType;

import static org.openjdk.btrace.core.BTraceUtils.Reflective.printFields;
import static org.openjdk.btrace.core.BTraceUtils.println;

@BTrace
public class GetIndexMethod {
 

    @OnMethod(clazz = "com.hong.springboot.controller.IndexController",method = "index1")
    public static void pre(@Self Object self, AnyType params){
        println("classPath:"+self);
        printFields(params);
        println("======end========");
 
    }
 

    @OnMethod(clazz = "com.hong.springboot.controller.IndexController",method = "index1",location = @Location(value = Kind.RETURN))
    public static void getReturn(@Return Object obj, AnyType params, @Duration long time){
        printFields(obj);
        printFields(params);
        println("time:"+time);
        println("======end========");
    }
}